package com.kefu.robot.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2021/11/23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "机器人引导问题")
public class RobotGuideRelSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "机器人ID")
    private String robotId;
    @ApiModelProperty(value = "知识ID")
    private String docId;
    @ApiModelProperty(value = "知识问题")
    private String docQuestion;

	public <T>QueryWrapper<T> builder() {
		QueryWrapper<T> wrapper=Wrappers.query();
	    if (StringUtils.isNotBlank(robotId)) {
	        wrapper.eq("robot_id", robotId);
	    }
	    if (StringUtils.isNotBlank(docId)) {
	        wrapper.eq("doc_id", docId);
	    }
	    if (StringUtils.isNotBlank(docQuestion)) {
	        wrapper.eq("doc_question", docQuestion);
	    }
	    return wrapper;
	}
}